package logic

import (
	"context"
	"shopping/model/mysql"
	"shopping/shoppingrpc/internal/svc"
	"shopping/shoppingrpc/shoppingrpc"

	"github.com/zeromicro/go-zero/core/logx"
)

type ShopLikeLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewShopLikeLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ShopLikeLogic {
	return &ShopLikeLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

func (l *ShopLikeLogic) ShopLike(in *shoppingrpc.ShopLikeRequest) (*shoppingrpc.ShopLikeResponse, error) {
	// todo: add your logic here and delete this line
	var products []mysql.Products
	mysql.DB.Debug().Where("id =?", in.Id).Find(&products)
	/*redis.Client.ZIncrBy("shopLike", 1,r)*/
	return &shoppingrpc.ShopLikeResponse{}, nil
}
